package io.modelcontextprotocol.autoconfigure.definition;


import io.modelcontextprotocol.autoconfigure.utils.ToolUtils;
import org.springframework.util.Assert;

import java.lang.reflect.Method;

public final class ToolDefinitions {
    private ToolDefinitions() {
    }

    public static DefaultToolDefinition.Builder builder(Method method) {
        Assert.notNull(method, "method cannot be null");
        return DefaultToolDefinition.builder().name(ToolUtils.getToolName(method))
                .description(ToolUtils.getToolDescription(method)).inputSchema(JsonSchemaGenerator.generateForMethodInput(method, new JsonSchemaGenerator.SchemaOption[0]));
    }

    public static ToolDefinition from(Method method) {
        return builder(method).build();
    }
}
